/**
 * @author PUSS1401
 *
 */

public class TimeReport {
	
	private String user, projectName;
	private int week;
	private String date;
	private int[] timeField1;
	private int[][] timeField2;
	private boolean signed, active;
	private int total, U, I, F, O;
	private int SDP, SRS, SVVS, STLDD, SVVI, SDDD, SVVR, SSD, FinalReport;

	/**
	 * @param user
	 * @param projectName
	 * @param week
	 * @param date
	 * @param timeField1
	 * @param timeField2
	 * @param signed
	 * @param active
	 */
	public TimeReport(String user, String projectName, int week, String date, boolean signed, boolean active, int[] timeField1, int[][] timeField2){
		this.user = user;
		this.projectName = projectName;
		this.week = week;
		this.date = date;
		this.timeField1 = timeField1;
		this.timeField2 = timeField2;
		this.signed = signed;
		this.active = active;
	} 
	
	/**
	 * Returns the name of the user this TimeReport belongs to.
	 * @return String
	 */
	public String getUser(){return user;}
	
	/**
	 * Returns the name of the project this TimeReport belongs to.
	 * @return String
	 */
	public String getProjectName(){return projectName;}
	
	/**
	 * Returns the week this TimeReport is for.
	 * @return Integer
	 */
	public int getWeek(){return week;}
	
	/**
	 * Returns the date represented by a string.
	 * @return String
	 */
	public String getDate(){return date;}
	
	/**
	 * Returns some of the values of time spent
	 * @return vector
	 */
	public int[]getTimeField1(){return timeField1;}
	
	/**
	 * Returns some of the values of time spent
	 * @return vector
	 */
	public int[][]  getTimeField2(){return timeField2;}
	
	/**
	 * Checks if this timereport is signed.
	 * @return boolean, true or false
	 */
	public boolean signed(){return signed;}
	
	/**
	 * Checks if this timereport is active.
	 * @return boolean, true or false
	 */
	public boolean active(){return active;}
	
	/**
	 * Calculates and returns total time spent for this timereport.
	 * @return Integer
	 */
	public int getTotalTime(){
		total=0;
		for(int i = 0; i < 9; i++){
			total += timeField1[i];
			for(int j = 0; j < 4; j++){
				total += timeField2[i][j];
			}
		}
		return total;
	}
	
	/**
	 * Calculates and returns the total time spent on developing for this timereport.
	 * @return Integer
	 */
	public int getU(){
		U = 0;
		for(int i = 0; i < 9; i++){
			U += timeField2[i][0];
		}
		return U;
	}
	
	/**
	 * Calculates and returns the total time spent on informal reviews for this timereport.
	 * @return Integer
	 */
	public int getI(){
		I = 0;
		for(int i = 0; i < 9; i++){
			I += timeField2[i][1];
		}
		return I;
	}
	
	/**
	 * Calculates and returns the total time spent on formal reviews for this timereport.
	 * @return Integer
	 */
	public int getF(){
		F = 0;
		for(int i = 0; i < 9; i++){
			F += timeField2[i][2];
		}
		return F;
		}
	
	/**
	 * Calculates and returns the total time spent on reworking for this timereport.
	 * @return Integer
	 */
	public int getO(){
		O = 0;
		for(int i = 0; i < 9; i++){
			O += timeField2[i][3];
		}
		return O;
	}	
	
	/**
	 * Calculates and returns the total time spent on SDP for this timereport.
	 * @return Integer
	 */
	public int getSDP(){
		SDP=0;
		for(int i=0; i<4;i++){
			SDP += timeField2[0][i];
		}
		return SDP;
	}
	
	/**
	 * Calculates and returns the total time spent on SRS for this timereport.
	 * @return Integer
	 */
	public int getSRS(){
		SRS=0;
		for(int i=0; i<4;i++){
			SRS += timeField2[1][i];
		}
		return SRS;
	}
	
	/**
	 * Calculates and returns the total time spent on SVVS for this timereport.
	 * @return Integer
	 */
	public int getSVVS(){
		SVVS=0;
		for(int i=0; i<4;i++){
			SVVS += timeField2[2][i];
		}
		return SVVS;
	}
	
	/**
	 * Calculates and returns the total time spent on STLDD for this timereport.
	 * @return Integer
	 */
	public int getSTLDD(){
		STLDD=0;
		for(int i=0; i<4;i++){
			STLDD += timeField2[3][i];
		}
		return STLDD;
	}
	
	/**
	 * Calculates and returns the total time spent on SVVI for this timereport.
	 * @return Integer
	 */
	public int getSVVI(){
		SVVI=0;
		for(int i=0; i<4;i++){
			SVVI += timeField2[4][i];
		}
		return SVVI;
	}
	
	/**
	 * Calculates and returns the total time spent on SDDD for this timereport.
	 * @return Integer
	 */
	public int getSDDD(){
		SDDD=0;
		for(int i=0; i<4;i++){
			SDDD += timeField2[5][i];
		}
		return SDDD;
	}
	
	/**
	 * Calculates and returns the total time spent on SVVR for this timereport.
	 * @return Integer
	 */
	public int getSVVR(){
		SVVR=0;
		for(int i=0; i<4;i++){
			SVVR += timeField2[6][i];
		}
		return SVVR;
	}
	
	/**
	 * Calculates and returns the total time spent on SSD for this timereport.
	 * @return Integer
	 */
	public int getSSD(){
		SSD=0;
		for(int i=0; i<4;i++){
			SSD += timeField2[7][i];
		}
		return SSD;
	}
	
	/**
	 * Calculates and returns the total time spent on Final report for this timereport.
	 * @return Integer
	 */
	public int getFinalReport(){
		FinalReport=0;
		for(int i=0; i<4;i++){
			FinalReport += timeField2[8][i];
		}
		return FinalReport;
	}

}